package sv.gob.mh.dgii.model.pojos.ie;

import java.io.Serializable;
import java.util.Date;
import sv.gob.mh.dgii.common.Utils;
import sv.gob.mh.dgii.model.IeFuenteDet;
import sv.gob.mh.dgii.model.IeFuente;
import sv.gob.mh.dgii.model.IeSolicitud;
import sv.gob.mh.dgii.model.RcRuc;
import sv.gob.mh.dgii.model.TbTipoContrib;
/**
 * <b>Created by </b>Mirdey
 * <b>for</b>siit
 * <b>on</b> January 30, 2013 14:11:07 PM
 * <b>Purpose</b> 
 * <p>
 * </p>
 */

public class IeCierreFuentesMasivoPojo implements Serializable {
 
    private IeFuenteDet ieFuenteDet;
    private IeFuente ieFuente;
    private RcRuc rcRuc;
    private Date lastmovement;
    private IeSolicitud ieSolicitud;

    public IeFuenteDet getIeFuenteDet() {
        return ieFuenteDet;
    }
    public void setIeFuenteDet(IeFuenteDet ieFuenteDet) {
        this.ieFuenteDet = ieFuenteDet;
    }

    public IeFuente getIeFuente() {
        return ieFuente;
    }
    public void setIeFuente(IeFuente ieFuente) {
        this.ieFuente = ieFuente;
    }

    public Date getLastmovement() {
        return lastmovement;
    }
    public void setLastmovement(Date lastmovement) {
        this.lastmovement = lastmovement;
    }

     public RcRuc getRcRuc() {
        return rcRuc;
    }
    public void setRcRuc(RcRuc rcRuc) {
        this.rcRuc = rcRuc;
    }
   
    public static String getNombreCompleto(RcRuc rcRuc) {
        String ret = null;
        try {
            TbTipoContrib tipoContrib = rcRuc.getTbTipoContrib();
            if (!Utils.isNullOrEmpty(rcRuc.getTbTipoContrib())) {
                if (tipoContrib.getTbClaseContrib().getCclase().equals("J")) {
                    ret = "" + " " + Utils.nvl(rcRuc.getS1apeRasoc(), "");
                } else {
                    ret = "" + " " + Utils.nvl(rcRuc.getSnombres(), "")
                            + " " + Utils.nvl(rcRuc.getS1apeRasoc(), "")
                            + " " + Utils.nvl(rcRuc.getS2apeAbrev(), "");
                }
            } else {
                ret = "" + " " + Utils.nvl(rcRuc.getSnombres(), "")
                        + " " + Utils.nvl(rcRuc.getS1apeRasoc(), "")
                        + " " + Utils.nvl(rcRuc.getS2apeAbrev(), "");
            }
        } catch (Exception e) {
        }
        return ret;
    }

    public IeSolicitud getIeSolicitud() {
        return ieSolicitud;
    }
    public void setIeSolicitud(IeSolicitud ieSolicitud) {
        this.ieSolicitud = ieSolicitud;
    }
}